#include "primitive.h"

namespace gc {
	template<>
	__global__ void gpu_new<Sphere>(void **ptr, const int size) {
		*ptr = new Sphere[size];
	}

	template<>
	__global__ void gpu_del<Sphere>(Primitive *ptr) {
		delete[](Sphere*)ptr;
	}

	template<>
	SimpleSphere* toSimpleClass<Sphere, SimpleSphere>(Sphere* polymorphic, const int size) {
		SimpleSphere* simple = new SimpleSphere[size];
		for (int i = 0; i < size; ++i) {
			simple[i] = polymorphic[i];
		}
		return simple;
	}
}